﻿using System.Collections.Generic;

namespace BorgExt
{
    public interface IInstanceStoreReader
    {
        IEnumerable<Extension> Extensions { get; }
        IEnumerable<Plug> Plugs { get; }
        IEnumerable<Slot> Slots { get; }

        IEnumerable<Extension> GetExtensions(string name);
        IEnumerable<Plug> GetPlugs(string name);
        IEnumerable<Slot> GetSlots(string name);

        MetaElementCollection<Slot> GetSlotsWherePlugged(Plug plug);
        MetaElementCollection<Plug> GetPluggedPlugs(Slot slot);

        MetaElementCollection<Slot> GetSlotsWhereSelected(Plug plug);
        MetaElementCollection<Plug> GetSelectedPlugs(Slot slot);

        MetaElementCollection<Extension> GetExtensions(ExtensionType extensionType);
        Extension GetSharedExtension(ExtensionType extensionType);

        Extension GetExtension(object extensionObject);
        object GetExtensionObject(Extension extension);

        Plug GetPlug(object extensionObject, string name);
        Slot GetSlot(object extensionObject, string name);

        bool IsActivated(Extension extension);
        bool IsOpen(Slot slot);

        bool IsPlugged(Slot slot, Plug plug);
        bool IsSelected(Slot slot, Plug plug);
    }
}

